package com.storm.monitor.dashboard.service.impl;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.beans.factory.annotation.Autowired;

import com.storm.monitor.dashboard.dao.ApmChartConfgMapper;
import com.storm.monitor.dashboard.service.ApmChartConfgService;
import com.storm.monitor.dashboard.model.ApmChartConfg;
import com.storm.monitor.dashboard.model.view.ApmChartConfgView;
import java.util.List;

/**
 *
 * Title: 【图表配置】(对应POJO对象：ApmChartConfg)服务实现类
 * Description: 包含对【图表配置】(ApmChartConfg)的增、删、改、查、构建等基本操作
 * Copyriht: Copyright (c) 2020
 * Company: Storm Workshop
 * @author lixin
 * @version 1.0 Date: 2018-10-19 09:45
 *
 */
@Service
@Transactional
public class ApmChartConfgServiceImpl implements ApmChartConfgService {

    @Autowired
    private ApmChartConfgMapper apmChartConfgMapper;

    /**
     * 新增一条记录
     *
     * @param apmChartConfg 待插入的【ApmChartConfg】实体
     * @return insert操作影响的数据库条数
     * @throws Exception
     */
    @Override
    public int addApmChartConfg(ApmChartConfg apmChartConfg) throws Exception {
        return apmChartConfgMapper.addApmChartConfg(apmChartConfg);
    }

    /**
     * 新增一批记录
     *
     * @param apmChartConfgs 待插入的【ApmChartConfg】实体集合
     * @return insert操作影响的数据库条数
     * @throws Exception
     */
    @Override
    public int addApmChartConfgBatch(List<ApmChartConfg> apmChartConfgs) throws Exception {
        return apmChartConfgMapper.addApmChartConfgBatch(apmChartConfgs);
    }

    /**
     * 更新一条数据库记录（全部字段）
     *
     * @param apmChartConfg 待更新的【ApmChartConfg】实体
     * @return update操作影响的数据库条数
     * @throws Exception
     */
    @Override
    public int updateApmChartConfg(ApmChartConfg apmChartConfg) throws Exception {
        return apmChartConfgMapper.updateApmChartConfg(apmChartConfg);
    }

    /**
     * 更新一条数据库记录（部分字段）
     *
     * @param apmChartConfg 待更新的【ApmChartConfg】实体
     * @return update操作影响的数据库条数
     * @throws Exception
     */
    @Override
    public int updateApmChartConfgBySelective(ApmChartConfg apmChartConfg) throws Exception{
        return apmChartConfgMapper.updateApmChartConfgBySelective(apmChartConfg);
    }

    /**
     * 删除一条数据库记录
     *
     * @param id 待删除的【ApmChartConfg】实体的ID
     * @return delete操作影响的数据库条数
     * @throws Exception
     */
    @Override
    public int deleteApmChartConfgById(java.lang.String id) throws Exception {
        return apmChartConfgMapper.deleteApmChartConfgById(id);
    }

    /**
     * 根据条件删除数据库记录
     *
     * @param apmChartConfgView
     * @return
     * @throws Exception
     */
    public int deleteApmChartConfgByCondition(ApmChartConfgView apmChartConfgView) throws Exception {
        return apmChartConfgMapper.deleteApmChartConfgByCondition(apmChartConfgView);
    }

    /**
     * 返回查询操作的结果
     *
     * @param apmChartConfg apmChartConfgView 查询操作的条件
     * @return 符合查询条件的记录
     * @throws Exception
     */
    @Override
    public List<ApmChartConfg> queryApmChartConfgByPage(ApmChartConfgView apmChartConfgView) throws Exception {
        return apmChartConfgMapper.queryApmChartConfgByPage(apmChartConfgView);
    }

    /**
     * 返回符合查询条件的记录总数
     *
     * @param apmChartConfgView apmChartConfgView 查询操作的条件
     * @return 符合查询条件的记录总数
     * @throws Exception
     */
    @Override
    public int queryApmChartConfgByCount(ApmChartConfgView apmChartConfgView) throws Exception {
        return apmChartConfgMapper.queryApmChartConfgByCount(apmChartConfgView);
    }

    /**
     * 根据主键查询记录
     *
     * @param id 主键ID
     * @return 一条数据库记录
     * @throws Exception
     */
    @Override
    public ApmChartConfg queryApmChartConfgById(Object id) throws Exception {
        return apmChartConfgMapper.queryApmChartConfgById(id);
    }
}
